package com.jaychen.eureka;

import com.jaychen.eureka.invoker.HttpInvokerHandler;
import com.jaychen.eureka.registry.DefaultInstanceRegistry;
import com.jaychen.eureka.result.GlobalResponseBodyHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author Jay Chen
 * @Date 2020/10/22 16:09
 */
@Configuration
public class AutoConfiguration {

    /**
     * 注入http请求处理
     *
     * @return HttpInvokerHandler
     */
    @Bean
    public HttpInvokerHandler httpInvokerHandler() {
        return new HttpInvokerHandler();
    }

    @Bean
    public DefaultInstanceRegistry defaultInstanceRegistry() {
        return new DefaultInstanceRegistry();
    }

    @Bean
    public GlobalResponseBodyHandler globalResponseBodyHandler() {
        return new GlobalResponseBodyHandler();
    }

}
